package com.duan.config;

import com.duan.interceptor.LogDemoInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author db
 * @version 1.0
 * @description LogInterceptorConfig
 * @since 2024/1/3
 */
@Configuration
public class LogInterceptorConfig implements WebMvcConfigurer {

    @Autowired
    private LogDemoInterceptor logDemoInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry){
        registry.addInterceptor(logDemoInterceptor).addPathPatterns("/**");

    }

}
